#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N = 2e5;
const int maxn = 1e6;
typedef long long int ll;
using namespace std;
//----------------------------------------------------------------------------//

void solve()
{
	int a, b, c;
	sd(a); sd(b); sd(c);
	if (a + c == 2 * b)
	{
		cout << "YES" << '\n';
		return;
	}
	//c-b公差
	int div = c - b;
	if (div>0&&(b-div)>0&&(b - div) % a == 0)
	{
		cout << "YES" << '\n';
		return;
	}
	//b-a公差
	div = b - a;
	if (div>0&&(b + div) % c == 0)
	{
		cout << "YES" << '\n';
		return;
	}
	//c-a公差
	div = (c - a) / 2;
	if (div<=0||(c - a) % 2 != 0)
	{
		cout << "NO" << '\n';
		return;
	}
	if (div>0&&(a + div) % b == 0 && (c-div)>0&&(c - div) % b == 0 && ((a + div) / b == (c - div) / b))
	{
		cout << "YES" << '\n';
		return;
	}
	cout << "NO" << '\n';
}

int main()
{
	int T;
	sd(T);
	while (T--)
	{
		solve();
	}
	return 0;
}